<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('收费标准列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('teaching:price:edit')}]];
    var prefix = ctx + "teaching/price";

    $(function () {
        var options = {
            url: ctx + "teaching/course/list",
            modalName: "收费标准",
            showSearch: false,
            showRefresh: false,
            showToggle: false,
            showColumns: false,
            pagination:false,
            columns: [{
                checkbox: false
            },
                {
                    field: 'courseId',
                    title: '主键ID',
                    visible: false
                },
                {
                    field: 'preName',
                    title: '课程前缀',
                    visible: false
                },
                {
                    field: 'name',
                    title: '课程名称',
                    formatter: function (value, row, index) {
                        return '<a href="javascript:void(0)" onclick="detail(\'' + row.courseId + '\')">' + value + '</a>';
                    }
                },
                {
                    field: 'category',
                    title: '课程类别'
                },
                {
                    field: 'subject',
                    title: '科目'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="detail(\'' + row.courseId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });

    /*课程-收费标准*/
    function detail(courseId) {
        var url = ctx + 'teaching/price/detail/' + courseId;
        $.modal.openTab("收费标准", url);
    }
</script>
</body>
</html>
